package ckw.gui;

import org.eclipse.jface.wizard.Wizard;

import ckw.database.model.Voter;

public class WzdAddEditVoter extends Wizard {

	private boolean addVoter;
	private Voter voter;

	private WzdPgAddEditVoter wzdPgAddEditVoter;

	public WzdAddEditVoter(boolean addVoter, Voter voter) {
		if (addVoter) {
			setWindowTitle("Add Voter");
		} else {
			setWindowTitle("Edit Voter");
		}

		this.addVoter = addVoter;
		this.voter = voter;
	}

	@Override
	public void addPages() {
		wzdPgAddEditVoter = new WzdPgAddEditVoter(addVoter, voter);
		addPage(wzdPgAddEditVoter);
	}

	@Override
	public boolean performFinish() {
		wzdPgAddEditVoter.update();

		return true;
	}

}
